package org.ares.app.demo.actions;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import javax.annotation.Resource;
import org.ares.app.demo.models.b;
import org.ares.app.demo.services.SimuSandService;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"/transportservice/action", "/simusand/api/v2"})
public class SimuAction {
    static final String KEY_CARID = "CarId";
    static final String KEY_CARACTION = "CarAction";
    static final String KEY_STATUS = "Status";
    static final String KEY_MONEY = "Money";
    static final String KEY_BALANCE = "Balance";
    static final String KEY_ROWS_DETAIL = "ROWS_DETAIL";
    static final String KEY_TRAFFICLIGHTID = "TrafficLightId";
    static final String KEY_TIME = "Time";
    static final String KEY_REDTIME = "RedTime";
    static final String KEY_GREENTIME = "GreenTime";
    static final String KEY_YELLOWTIME = "YellowTime";
    static final String KEY_ROADLIGHTID = "RoadLightId";
    static final String KEY_ACTION = "Action";
    static final String KEY_CONTROLMODE = "ControlMode";
    static final String KEY_SENSENAME = "SenseName";
    static final String KEY_LIGHTSENSE_DOWN = "Down";
    static final String KEY_LIGHTSENSE_UP = "Up";
    static final String KEY_BUSID = "BusId";
    static final String KEY_BUSSTATIONID = "BusStationId";
    static final String KEY_ROADID = "RoadId";
    @Resource
    SimuSandService ssService;

    public SimuAction() {
    }

    @RequestMapping({"/SetCarMove", "set_car_move"})
    public Map<String, Object> setCarMove(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("CarId");
        String var4 = (String)param.get("CarAction");
        if (!StringUtils.isEmpty(var3) && !StringUtils.isEmpty(var4)) {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var5 = Integer.parseInt(var3.trim());
            this.ssService.setCarAction(var5, var4);
            return var2;
        } else {
            throw new RuntimeException("request param is lose");
        }
    }

    @RequestMapping({"/GetCarMove", "/get_car_move"})
    public Map<String, Object> getCarMove(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("CarId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            var2.put("Status", this.ssService.getCarAction(var4));
            return var2;
        }
    }

    @RequestMapping({"/GetCarAccountBalance", "/get_car_account_balance"})
    public Map<String, Object> getCarAccountBalance(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("CarId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            var2.put("Balance", this.ssService.getCarAccountBalance(var4));
            return var2;
        }
    }

    @RequestMapping({"/SetCarAccountRecharge", "/set_car_account_recharge"})
    public Map<String, Object> setCarAccountRecharge(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("CarId");
        String var4 = (String)param.get("Money");
        if (!StringUtils.isEmpty(var3) && !StringUtils.isEmpty(var4)) {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var5 = Integer.parseInt(var3.trim());
            Integer var6 = Integer.parseInt(var4.trim());
            this.ssService.setCarAccountRecharge(var5, var6);
            return var2;
        } else {
            throw new RuntimeException("request param is lose");
        }
    }

    @RequestMapping({"/GetCarAccountRecord", "/get_car_account_record"})
    public Map<String, Object> getCarAccountRecord(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("CarId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            var2.put("ROWS_DETAIL", this.ssService.getCarAccountRecord(var4));
            return var2;
        }
    }

    @RequestMapping({"/SetCarAccountFee", "/set_car_account_fee"})
    public Map<String, Object> setCarAccountFee(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("CarId");
        String var4 = (String)param.get("Money");
        if (!StringUtils.isEmpty(var3) && !StringUtils.isEmpty(var4)) {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var5 = Integer.parseInt(var3.trim());
            Integer var6 = Integer.parseInt(var4.trim());
            this.ssService.setCarAccountFee(var5, var6);
            return var2;
        } else {
            throw new RuntimeException("request param is lose");
        }
    }

    @RequestMapping({"/GetCarAccountFee", "/get_car_account_fee"})
    public Map<String, Object> getCarAccountFee(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("CarId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            var2.put("ROWS_DETAIL", this.ssService.getCarAccountFee(var4));
            return var2;
        }
    }

    @RequestMapping({"/SetTrafficLightNowStatus", "/set_trafficlight_now_status"})
    public Map<String, Object> setTrafficLightNowStatus(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("TrafficLightId");
        String var4 = (String)param.get("Status");
        String var5 = (String)param.get("Time");
        if (!StringUtils.isEmpty(var3) && !StringUtils.isEmpty(var4) && !StringUtils.isEmpty(var5)) {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var6 = Integer.parseInt(var3.trim());
            Integer var7 = Integer.parseInt(var5.trim());
            this.ssService.setTrafficLightNowStatus(var6, var4, var7);
            return var2;
        } else {
            throw new RuntimeException("request param is lose");
        }
    }

    @RequestMapping({"/GetTrafficLightNowStatus", "/get_trafficlight_now_status"})
    public Map<String, Object> getTrafficLightNowStatus(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("TrafficLightId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            Map var5 = this.ssService.getTrafficLightNowStatus(var4);
            var5.keySet().stream().forEach((e) -> {
                var2.put(e, var5.get(e));
            });
            return var2;
        }
    }

    @RequestMapping({"/SetTrafficLightConfig", "/set_trafficlight_config"})
    public Map<String, Object> setTrafficLightConfig(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("TrafficLightId");
        String var4 = (String)param.get("RedTime");
        String var5 = (String)param.get("GreenTime");
        String var6 = (String)param.get("YellowTime");
        if (!StringUtils.isEmpty(var3) && !StringUtils.isEmpty(var4) && !StringUtils.isEmpty(var5) && !StringUtils.isEmpty(var6)) {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var7 = Integer.parseInt(var3.trim());
            Integer var8 = Integer.parseInt(var4.trim());
            Integer var9 = Integer.parseInt(var5.trim());
            Integer var10 = Integer.parseInt(var6.trim());
            this.ssService.setTrafficLightConfig(var7, var8, var9, var10);
            return var2;
        } else {
            throw new RuntimeException("request param is lose");
        }
    }

    @RequestMapping({"/GetTrafficLightConfigAction", "/get_trafficlight_config"})
    public Map<String, Object> getTrafficLightConfigAction(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("TrafficLightId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            Map var5 = this.ssService.getTrafficLightConfigAction(var4);
            var5.keySet().stream().forEach((e) -> {
                var2.put(e, var5.get(e));
            });
            return var2;
        }
    }

    @RequestMapping({"/SetRoadLightControlMode", "/set_roadlight_control_mode"})
    public Map<String, Object> setRoadLightControlMode(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("ControlMode");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            this.ssService.setRoadLightControlMode(var3);
            return var2;
        }
    }

    @RequestMapping({"/GetRoadLightControlMode", "/get_roadlight_control_mode"})
    public Map<String, Object> getRoadLightControlMode(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ControlMode", this.ssService.getRoadLightControlMode());
        return var2;
    }

    @RequestMapping({"/SetRoadLightStatusAction", "/set_roadlight_status"})
    public Map<String, Object> setRoadLightStatusAction(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("RoadLightId");
        String var4 = (String)param.get("Action");
        if (!StringUtils.isEmpty(var3) && !StringUtils.isEmpty(var4)) {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var5 = Integer.parseInt(var3.trim());
            this.ssService.setRoadLightStatusAction(var5, var4);
            return var2;
        } else {
            throw new RuntimeException("request param is lose");
        }
    }

    @RequestMapping({"/GetRoadLightStatus", "/get_roadlight_status"})
    public Map<String, Object> getRoadLightStatus(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("RoadLightId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            String var5 = this.ssService.getRoadLightStatus(var4);
            var2.put("Status", var5);
            return var2;
        }
    }

    @RequestMapping({"/GetAllSense", "/get_all_sense"})
    public Map<String, Object> getAllSense() {
        HashMap var1 = new HashMap();
        var1.put("RESULT", "S");
        var1.put("ERRMSG", "成功");
        Map var2 = this.ssService.getAllSense();
        var2.keySet().stream().forEach((e) -> {
            var1.put(e, var2.get(e));
        });
        return var1;
    }

    @RequestMapping({"/GetSenseByName", "/get_sense_by_name"})
    public Map<String, Object> getSenseByName(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("SenseName");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Object var4 = this.ssService.getSenseByName(var3);
            var2.put(var3, var4);
            return var2;
        }
    }

    @RequestMapping({"/SetLightSenseValue", "/set_light_sense_value"})
    public Map<String, Object> setLightSenseValve(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("Down");
        String var4 = (String)param.get("Up");
        if (!StringUtils.isEmpty(var3) && !StringUtils.isEmpty(var4)) {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var5 = Integer.parseInt(var3.trim());
            Integer var6 = Integer.parseInt(var4.trim());
            this.ssService.setLightSenseValve(var5, var6);
            return var2;
        } else {
            throw new RuntimeException("request param is lose");
        }
    }

    @RequestMapping({"/GetLightSenseValue", "/get_light_sense_value"})
    public Map<String, Object> getLightSenseValve(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        Map var3 = this.ssService.getLightSenseValve();
        var3.keySet().stream().forEach((e) -> {
            var2.put(e, var3.get(e));
        });
        return var2;
    }

    @RequestMapping({"/GetBusCapacity", "/get_bus_capacity"})
    public Map<String, Object> getBusCapacity(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("BusId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            int var5 = this.ssService.getBusCapacity(var4);
            var2.put("BusCapacity", var5);
            return var2;
        }
    }

    @RequestMapping({"/GetWeather", "/get_weather"})
    public Map<String, Object> getWeather(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        Map var3 = this.ssService.getWeather();
        var3.keySet().stream().forEach((e) -> {
            var2.put(e, var3.get(e));
        });
        return var2;
    }

    @RequestMapping({"/GetBusStationInfo", "/get_bus_station_info"})
    public Map<String, Object> getBusStationInfo(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("BusStationId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            byte var5 = 10;
            var2.put("ROWS_DETAIL", this.ssService.getBusStationInfo(var4, var5));
            return var2;
        }
    }

    @RequestMapping({"/GetRoadStatus", "/get_road_status"})
    public Map<String, Object> getRoadStatus(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("RoadId");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            var2.put("Status", this.ssService.getRoadStatus(var4));
            return var2;
        }
    }

    @RequestMapping({"/SetEtcRate", "/set_etc_rate"})
    public Map<String, Object> setEtcRate(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        String var3 = (String)param.get("Money");
        if (StringUtils.isEmpty(var3)) {
            throw new RuntimeException("request param is lose");
        } else {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            Integer var4 = Integer.parseInt(var3.trim());
            this.ssService.setEtcRate(var4);
            return var2;
        }
    }

    @RequestMapping({"/GetEtcRate", "/get_etc_rate"})
    public Map<String, Object> getEtcRate(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        int var3 = this.ssService.getEtcRate();
        var2.put("Money", var3);
        return var2;
    }

    @RequestMapping({"/GetEtcTtrafficLog", "/get_etc_traffic_log"})
    public Map<String, Object> getEtcTtrafficLog(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.getEtcTtrafficLog());
        return var2;
    }

    @RequestMapping({"/SetEtcBlacklist", "/set_etc_blacklist"})
    public Map<String, Object> setEtcBlacklist(@RequestBody b param) {
        HashMap var2 = new HashMap();
        String var3 = param.a();
        List var4 = param.b();
        if (!StringUtils.isEmpty(var3) && var4 != null) {
            var2.put("RESULT", "S");
            var2.put("ERRMSG", "成功");
            this.ssService.setEtcBlacklist(var4, var3);
            return var2;
        } else {
            throw new RuntimeException("request param is lose");
        }
    }

    @RequestMapping({"/GetEtcBlacklist", "/get_etc_blacklist"})
    public Map<String, Object> getEtcBlacklist(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.getEtcBlacklist((String)param.get("UserName")));
        return var2;
    }

    @RequestMapping({"GetTravelInfo", "/get_travel_info"})
    public Map<String, Object> getTravelInfo(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.getTravelInfo((String)param.get("id")));
        return var2;
    }

    @RequestMapping({"SetTravelOrder", "/set_travel_order"})
    public Map<String, Object> setTravelOrder(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        this.ssService.setTravelOrder(param);
        return var2;
    }

    @RequestMapping({"GetTravelOrder", "/get_travel_order"})
    public Map<String, Object> getTravelOrder(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.gettTravelOrder((String)param.get("UserName")));
        return var2;
    }

    @RequestMapping({"GetNewsInfo", "/get_news_info"})
    public Map<String, Object> getNewsInfo(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.getTravelNews(Integer.valueOf((String)param.get("Category"))));
        return var2;
    }

    @RequestMapping({"GetNotice", "/get_notice"})
    public Map<String, Object> getNotice() {
        HashMap var1 = new HashMap();
        var1.put("RESULT", "S");
        var1.put("ERRMSG", "成功");
        var1.put("ROWS_DETAIL", this.ssService.getTravelNotice());
        return var1;
    }

    @RequestMapping({"SetSuggestion", "/set_suggestion"})
    public Map<String, Object> setSuggestion(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        this.ssService.setTravelSuggestion(param);
        return var2;
    }

    @RequestMapping({"GetAllSuggestion", "/get_all_suggestion"})
    public Map<String, Object> getAllSuggestion(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.getTravelSuggestion((String)param.get("UserName")));
        return var2;
    }

    @RequestMapping({"FeedBack", "/feedback"})
    public Map<String, Object> feedBack(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        this.ssService.setFeedBack(param);
        return var2;
    }

    @RequestMapping({"SetBuslineOrder", "/set_busline_order"})
    public Map<String, Object> commitorder(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        this.ssService.setCommitOrder(param);
        return var2;
    }

    @RequestMapping({"SetRate", "/set_rate"})
    public Map<String, Object> setRate(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        this.ssService.setRate(param);
        return var2;
    }

    @RequestMapping({"GetMetro", "/get_metro"})
    public Map<String, Object> searchMetro() {
        HashMap var1 = new HashMap();
        var1.put("RESULT", "S");
        var1.put("ERRMSG", "成功");
        var1.put("ROWS_DETAIL", this.ssService.getTravelMetro());
        return var1;
    }

    @RequestMapping({"GetBuslineInfo", "/get_busline_info"})
    public Map<String, Object> getCustomizedBus() {
        HashMap var1 = new HashMap();
        var1.put("RESULT", "S");
        var1.put("ERRMSG", "成功");
        var1.put("ROWS_DETAIL", this.ssService.getCustomizedBus());
        return var1;
    }

    @RequestMapping({"GetBuslineOrder", "/get_busline_order"})
    public Map<String, Object> getorderitem(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.getOrderItem((String)param.get("UserName")));
        return var2;
    }

    @RequestMapping({"GetCarHistory", "/get_car_history"})
    public Map<String, Object> getcarhistory(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.carHistory(param));
        return var2;
    }

    @RequestMapping({"GetPark", "/get_park"})
    public Map<String, Object> getparkmessage(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.getpark());
        return var2;
    }

    @RequestMapping({"GetTravelAllInfo", "/get_travel_all_info"})
    public Map<String, Object> gettravelallinfo(@RequestBody Map<String, String> param) {
        HashMap var2 = new HashMap();
        var2.put("RESULT", "S");
        var2.put("ERRMSG", "成功");
        var2.put("ROWS_DETAIL", this.ssService.getTravelAllInfo());
        return var2;
    }
}
